package com.example.spring3.mapper;

import com.example.spring3.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {
    @Insert("insert into User(username,password,phone,email) values(#{username},#{password},#{phone},#{email})")
    public int insert(String username, String password, String phone, String email);

    @Select("select count(*) from user where username=#{username}")
    public int selectByUsername(String username);

    @Select("select * from user where username=#{username}")
    public User findByUsername(String username);
}
